package com.example.config;

import java.io.FileWriter;
import java.io.IOException;

public class AlipayConfig {
    //↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2021000117600338";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCQUoN8e5Auac8igvg7ifvcL32cXNrqBNBHQ7AilOFd1UBOgH9i0+CgZllMLt0NmjXiHIzaIyBT1AhRDM3TC+pIvKrIvHzC9J+eCTQTScQAIl15uoslDbUW2NVa7bN5/CubvgQrdArxRt1xTCyW1wbHdWVMl/J+T6E0+/ToiC3L1IPqwTXgQfpvJTm5TraaoJyMpkl4pfknTv1rok2A+exf1Roc2y+kvlOOwQPBMVNb/gi1wkXRw38OchMFSP821kjp0IItmKiZvVxJygbIMC2UD0sfJwfjlnWb7XQfik5nqGFb5fbOiTAO6TqJUsQVMzxIi5kr0TDxAUNjoiPEpMbPAgMBAAECggEAbNovXfZ8WuVnW2pY+98o3XvcS9ElNBiJVxbQhGSyTmmHZS455jpUU+aeN32pMJc9SNuryONxgIiN9UOpAiMcg9v5HAo+N3T15uaeJmYetNM2mZd/V2UtTpwg38Ik+j6eTYtV7chKcIy4fLmtb9+it1HuI4T/WxGIT0QyBiigEfmAckyGEMJ1FuR6ARS1JeXGSKoX5u+5EpuWnzVYvM10MTPS4peVqF9D57ou7qNlfxWbt/B4+uBbuf6U1edgGG7iGUSk7WJ4+vFo3a1aIYIUrs5hHPoOCtJxWqcTJrnxVukD1uVbwRU+JgwqLqUujpR+XdRqkAujGLaNnkmvuWLhQQKBgQDwnHj2RIKXYYqjkGNQ7ayR8+3OFYT+fCQz++5leegmHobQXfS1npoD3cUI7uWywwckJW3JiTx8tCtD84YIX1JOWa1F6pcXGITyUJQ5HWoOrYN5xIwp6XMmyQ7W6tHTGZ/Cd+OA/0rB1kuoOVQt+9TlGzuEv6TwFZb7AfrhTJb83wKBgQCZjYC/+tUD8DBsA91u7BdkgKAzH7hqDscC7g+olWYa01AxiWX7vQzpNA4VEIkSHp6Qt6tFZjJEP7osQi88vTtlnO+2mdSnYlH35PAytKovGJSfYSfTMJZ9JlUxxd+FW6xmFl/wQrCclm1SiJgmJnIBcQUAmur4hliW5DCDuCWEEQKBgFZehJk6DHqUm/SMruns9wZJPnK8jMng/AnhBDlO4kNUr+X55A6RyQ1cPQ8w2ikqEtUpzlgKuDi3X9R7hQBaXywayrUPOX8j4Q0uWZaK9XghVtGN+RZOY3Rntbj1/628Q/nFmVfDzCz6ZJwVQB9lh41aEipbtLQtu82Mb2cSXByXAoGAL+ejiUFZ/5aJpMk35gkl6ybt08VLpVri35khrXiemDPgyvOQq475Xi/tTMkR2mNPGNsURdxyRjSTgodLcWmgBD2H07H+VBIqfGoiPc97YKIMjASlhg+cg4LYBWU0LMjC6j6Ew9Iqg0+y35LZ1N0dqDF4XA34zHwtWzXppM5odeECgYBhv5E9/dPX7k7eYeMBfiBqm+tGrp1i2ttv5npRHCSaGZNy12tJcc2UXyKcmXG9dVDtklo59H07Fww8nrlx15VNCRlB4tBqMMSyqLlRrPy2F69IrKz/6GyYyM4B+/z/qVPlTcY2GTo6GKWRELw8yee3TnrpX4npz7rua8S+bldf8w==";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApb7ICv1bNUcOqGEgH43gUGLUI0V3Erpv0pAQ1S2FzmAMs9VaxRBubXHD+srWBI+YHia+nYvub189WEZT7KOWo9hjtL1mH7ToU0nlYukELzlFDVxHY25KgSQq2GiaEap72Huq54tEf1MCmubPkBHCfY0acNvV3oGeodPrXQE5RLLXT5adQTeW4QpXzL88CKRV/nKtNBLNIyn+So+2qCSuBIVTIbZmJCPYCC6txFh+feD9rJI6M4zbzssoY58k8fUOXBR34hrwPBQEqNPOwAYoz3n5BtKEqPBE/4EDa/rRQNe4cXkF1kgPQ0DqoChk36BBdytIQt0YP3k8Gs9Wr9rPrwIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://zhudongdong.free.idcfengye.com/alipay_notify";


    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://zhudongdong.free.idcfengye.com/list";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "D:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
